package top.kaoshanji.q1ch07a.web;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import top.kaoshanji.q1ch07a.exception.AppWideException;

/**
 * 代码清单-q1ch07a-219页a：使用@ControllerAdvice，为所有的控制器处理异常
 * @author kaoshanji
 * ^_^
 * create time 2025/4/25 15:26
 */
@ControllerAdvice
public class AppWideExceptionHandler {

    @ExceptionHandler(AppWideException.class)
    public String appWideException() {
        return "error/appWideException";
    }

}
